#include<bits/stdc++.h>
using namespace std;
const int K = 5;
int T;
long long n,ans;
void Calc(long long k)
{
	if((n & 1) && !(k & 1))
		return;
	long long res = k + 1,add = n / k;
	if(!(n % k))
		return ans = min(ans,res + add),void();
	if(((n % k) & 1) == (k & 1))
		return ans = min(ans,res + add + 1),void();
	else
		return ans = min(ans,res + add + 2),void();
}
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0),cout.tie(0);
	freopen("tree.in","r",stdin);
	freopen("tree.out","w",stdout);
	cin >> T;
	while(T--)
	{
		cin >> n;
		ans = n + 2;
		long long M = sqrt(n);
		for(int k = max(M - K,1ll);k <= min(M + K,n);k++)
			Calc(k);
		cout << ans << "\n";
	}
	return 0;
}
